package com.unf.edu.rms.util;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {
	
	public static Date strToDate(String dateStr)
	{
		try {
			DateFormat formatter;
			Date date;
			formatter = new SimpleDateFormat("MM/dd/yyyy");
			date = (Date) formatter.parse(dateStr);
			System.out.println("Today is " + date);
			return date;
		} catch (ParseException e) {
			
			System.out.println("Exception :" + e);
		}
		return null;
	}
	
	public static String dateToStr(Date date){
		System.out.println("DateUtil.dateToStr()========="+date);
		SimpleDateFormat formatDateJava = new SimpleDateFormat("MM/dd/yyyy");
		String dateStr = formatDateJava.format(date);
		return dateStr;
	}
}
